package gdkm.wsz.dao;

import gdkm.wsz.pojo.Student_info;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;

public interface Student_infoDAO {
    @Select("select * from student_info where id=#{id}")
    Student_info selectById(Long id);

    @Select("select * from student_info")
    List<Student_info> selectAll();

    @Insert("insert into student_info(user_id,real_name,gender,birthday,id_card,university,major,education,graduation_time,political_status,hometown,current_city,job_intention,job_type,salary_expectation,self_introduction,create_time,update_time) values(#{userId},#{realName},#{gender},#{birthday},#{idCard},#{university},#{major},#{education},#{graduationTime},#{politicalStatus},#{hometown},#{currentCity},#{jobIntention},#{jobType},#{salaryExpectation},#{selfIntroduction},#{createTime},#{updateTime})")
    int insert(Student_info studentInfo);

    @Update("update student_info set user_id=#{userId},real_name=#{realName},gender=#{gender},birthday=#{birthday},id_card=#{idCard},university=#{university},major=#{major},education=#{education},graduation_time=#{graduationTime},political_status=#{politicalStatus},hometown=#{hometown},current_city=#{currentCity},job_intention=#{jobIntention},job_type=#{jobType},salary_expectation=#{salaryExpectation},self_introduction=#{selfIntroduction},update_time=#{updateTime} where id=#{id}")
    int update(Student_info studentInfo);

    @Delete("delete from student_info where id=#{id}")
    int deleteById(Long id);

    @Select("select * from student_info where user_id=#{userId}")
    Student_info selectByUserId(Long userId);
}
